Skip to content

build(ENG-12825): migrate packaging to uv + pyproject.toml#317

Draft
BartoszBlizniak wants to merge 3 commits into
masterfrom
eng-12825-migrate-cli-packaging-to-uv-pyprojecttoml
Draft

build(ENG-12825): migrate packaging to uv + pyproject.toml#317
BartoszBlizniak wants to merge 3 commits into
masterfrom
eng-12825-migrate-cli-packaging-to-uv-pyprojecttoml

Conversation

@BartoszBlizniak

Copy link
Copy Markdown
Member

Description

Migrate CLI packaging to pyproject.toml + uv (with a locked uv.lock) as a single source of truth, replacing setup.py, setup.cfg, and requirements.{in,txt}. CI (test.yml, lint.yml) now runs through uv. No change to CLI behaviour.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Other (please describe)

Additional Notes

  • Build/packaging only — the CLI is unchanged; uv build produces the same wheel + sdist.
  • requirements.txt is removed; uv export regenerates a pinned list if a consumer needs one.
  • Groundwork for distributing the CLI as a standalone binary.

@BartoszBlizniak BartoszBlizniak changed the title build: migrate packaging to uv + pyproject.toml build(ENG-12825): migrate packaging to uv + pyproject.toml Jun 19, 2026
@BartoszBlizniak BartoszBlizniak requested a review from Copilot June 19, 2026 12:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the CLI’s packaging and dependency management from setup.py/setup.cfg + requirements.{in,txt} to pyproject.toml with uv.lock as the lockfile source of truth, and updates CI/dev bootstrap to use uv accordingly.

Changes:

  • Replaces legacy packaging/requirements files with a pyproject.toml-based build and uv dependency groups/lockfile workflow.
  • Updates GitHub Actions CI (tests + lint) and local direnv bootstrap (.envrc) to install/run via uv.
  • Adds prompt unstyling for Click confirm prompts in non-TTY contexts and adjusts tests for newer Click behavior / contextmanager formatting.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
setup.py Removed legacy setuptools packaging entrypoint in favor of pyproject.toml.
setup.cfg Removed legacy wheel/pytest/coverage configuration now represented in pyproject.toml.
requirements.txt Removed pip-tools compiled lockfile; uv.lock becomes the pinned source of truth.
requirements.in Removed dev dependency input file; dev deps move to pyproject.toml dependency groups.
pyproject.toml New packaging/build configuration, dependencies, and pytest/coverage config in one place.
CONTRIBUTING.md Updates contributor setup instructions to reference uv + pyproject.toml/uv.lock.
cloudsmith_cli/core/tests/test_generic_detector.py Makes environment detection test resilient by disabling AWS detector in context.
cloudsmith_cli/core/tests/test_detector_controls.py Refactors multi-patch with statement into modern parenthesized form.
cloudsmith_cli/cli/utils.py Adds maybe_unstyle_prompt() and routes confirmation prompts through it.
cloudsmith_cli/cli/tests/commands/test_tokens.py Refactors stacked patch() calls into parenthesized with form.
cloudsmith_cli/cli/tests/commands/test_metadata.py Adjusts assertion to unstyle output to avoid ANSI-split substrings.
cloudsmith_cli/cli/tests/commands/test_mcp.py Refactors stacked patch() calls into parenthesized with form.
cloudsmith_cli/cli/tests/commands/test_check.py Refactors stacked patch() calls into parenthesized with form.
AGENTS.md Updates agent/dev guidance to reflect uv/pyproject.toml/uv.lock.
.github/workflows/test.yml Switches matrix test job setup/install/run steps from pip to uv.
.github/workflows/lint.yml Consolidates linting into a single uv + pre-commit job and adds concurrency control.
.envrc Updates local bootstrap to uv sync --locked --group dev instead of pip/requirements files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread pyproject.toml
Comment thread pyproject.toml
Comment thread AGENTS.md Outdated
- release.yml: replace `python setup.py sdist bdist_wheel` with `uv build`
  in both the build and publish-pypi jobs (setup.py was removed); add
  `astral-sh/setup-uv` steps (with caching disabled to satisfy zizmor's
  cache-poisoning audit on this tag-triggered publishing workflow); correct
  the pushed wheel filename from `*-py2.py3-none-any.whl` to
  `*-py3-none-any.whl` to match the new build output.
- AGENTS.md: drop the reference to `packaging/constraints.txt`, which does
  not exist on this branch (it belongs to the separate binary-build work),
  keeping only the accurate pyproject.toml + uv.lock guidance.

Declined (with evidence):
- pyproject.toml license string: PEP 639 SPDX string `license = "Apache-2.0"`
  is valid for setuptools 82.0.1; `uv build` succeeds and emits
  `License-Expression: Apache-2.0` in METADATA.
- Apache license classifier: PEP 639 supersedes license classifiers; adding
  it makes setuptools 82.0.1 raise InvalidConfigError and breaks the build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants